import { SET, SET_SHOW, SET_NAV_BAR_HEIGHT } from "../constants/config";

const INITIAL_STATE = {
  selected: 0,
  show: true,
  navBarHeight: 0,
};

export default function config(state = INITIAL_STATE, action) {
  switch (action.type) {
    case SET:
      return {
        ...state,
        selected: action.data,
      };
    case SET_SHOW:
      return {
        ...state,
        show: action.data,
      };
    case SET_NAV_BAR_HEIGHT:
      return {
        ...state,
        navBarHeight: action.data,
      };
    default:
      return state;
  }
}
